package top.kuxiao.crmserver.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import top.kuxiao.crmserver.pojo.Opportunity;
import top.kuxiao.crmserver.service.IOpportunityService;
import top.kuxiao.crmserver.utils.Auth;
import top.kuxiao.crmserver.utils.ResultUtil;

import java.util.List;

/**
 * <p>
 * 销售机会来源 前端控制器
 * </p>
 *
 * @author xiaozhang
 * @since 2022-01-12
 */
@CrossOrigin
@RestController
@Api(tags ="销售机会来源")
@RequestMapping("/opportunity")
public class OpportunityController {

    @Autowired
    IOpportunityService opportunityService;

    @Auth("SE,AM")
    @ApiOperation(value = "机会来源")
    @RequestMapping(value = "oop",method = RequestMethod.POST)
    public ResultUtil oopList(){
        List<Opportunity> list = opportunityService.list();
        return ResultUtil.resObj(list);
    }

}
